<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" async="" src="shopcar/joya.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta http-equiv="Cache-Control" content="no-siteapp">


    <title>我的购物车-格调同城,只为更好的生活</title>


    <!--css start-->
    <link href="shopcar/global_site_simple.css" rel="stylesheet" type="text/css">
    <link href="shopcar/cart_main.css" rel="stylesheet" type="text/css">
    <!--css end-->


    <script async="" src="shopcar/gatherInfo.js"></script>
    <script type="text/javascript" charset="UTF-8" src="shopcar/login_frame_client.js"></script>
</head>

<body id="comParamId" data-param="{&quot;globalPageCode&quot;:&quot;-1&quot;,&quot;currPageId&quot;:&quot;-1&quot;}"
      class="">

<div class="hd_header_wrap">
    <div class="hd_top_bar">
        <div class="wrap clearfix">
            <a href="" class="hd_topbar_home">
                <i class="hd_iconfont"></i>
                <span>格调同城首页</span>
            </a>

            <div class="" id="headerSelectProvince" clstag="pageclick|keycount|global_201709226|1"></div>
            <div class="hd_topbar_right">
                <ul>
                    <li id="global_unlogin">
                        <div class="hd_unlogin" clstag="pageclick|keycount|shouye_20181018|toolbar_Login">
                            <span class="hd_hi">你好:</span>
                            <a href="login.html" class="hd_login_link" id="dl">登录&nbsp;</a>
                            <a href="register.html" class="hd_regist_link" id="zc">&nbsp;注册</a>
                        </div>
                    </li>
                    <li id="global_login" class="" style="display:none" data-type="2017">
                        <div class="hd_login">
                            <div class="hd_login_name_con">
                                <span class="hd_hi">你好,</span>
                                <a href="" id="name" class="hd_login_name"></a>

                            </div>
                            <a href="" class="hd_vip hd_vip__gradeStyle__" ><img id="imgValidateCode" src="" style="width: 100px;height: 35px;margin-top: -10px"></a>&nbsp;&nbsp;
                            <a id="tc" onclick="tc()">退出</a>
                        </div>
                    </li>
                    <li clstag="pageclick|keycount|global_201709226|5">
                        <div class="hd_menu hd_notice" id="hdUserMsg" style="display: none" data-cfg="1">
                            <a href="" rel="nofollow" target="_blank">我的消息&nbsp;(<em class="hd_has_num">0</em>)</a>
                        </div>
                    </li>
                    <li clstag="pageclick|keycount|global_201709226|6">
                        <div class="hd_menu">
                            <a href="" target="_blank" rel="nofollow"><i class="hd_iconfont"></i>我的订单</a>
                        </div>
                    </li>
                    <li class="hd_has_child" clstag="pageclick|keycount|global_201709226|7">
                        <div class="hd_menu">
                            <a href="" target="_blank">客户服务</a>
                            <i class="hd_iconfont"></i>
                        </div>
                        <div class="hd_menu_list">
                            <a href="" target="_blank" title="包裹跟踪">包裹跟踪</a>
                            <a href="" target="_blank" title="在线退换货">在线退换货</a>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div id="mark_mask"
     style="display:none;position:fixed;top:40px;left:0;z-index:99999999;height:1000px;width:100%;background:rgba(0,0,0,0.4);"></div>
<!--content start-->
<script type="text/javascript">
    console || function () {
        var console = {};
        console.log = function () {
        };
    };

    function ready(fn) {
        if (document.addEventListener) {
            document.addEventListener('DOMContentLoaded', function () {
                //注销事件, 避免反复触发
                document.removeEventListener('DOMContentLoaded', arguments.callee, false);
                fn();            //执行函数
            }, false);
        } else if (document.attachEvent) {        //IE
            document.attachEvent('onreadystatechange', function () {
                if (document.readyState == 'complete') {
                    document.detachEvent('onreadystatechange', arguments.callee);
                    fn();        //函数执行
                }
            });
        }
    };

    ready(function () {
        document.getElementById('headerSelectProvince').innerHTML = '';
        document.getElementById('headerSelectProvince').setAttribute('class', '');

        //网盟
        window.synccookie.dosync('unpl');
        var isSmallscreen = screen.width <= 1280;
        if (isSmallscreen) {
            document.getElementsByTagName("body")[0].className = "w980";
        }
    });
</script>
<div class="yhd_cart_content">

    <div class="cart_header  wrap clearfix">
        <h1>
            <a href="" class="logo"></a>
            <a href="javascript:;" class="logo_txt"></a>
        </h1>
        <!-- 三级地址选择 strat-->
        <div class="area_wrapper">
            <span class="area_txt">配送至：</span>
            <div class="mod_area_select" style="position: relative; top: 0px;">
                <div class="address" id="completed_address" data-tpa="CART_ADDRESS_AREA">
                    <span class="val_text" id="detail_area_name">上海<i>|</i>静安区<i>|</i>城区</span>
                    <i class="btn_arrow"></i>
                </div>
                <div class="tab_box none" style="display: none;">
                    <a href="javascript:;" class="close"></a>
                    <div class="tabs clearfix">
                        <span class="on"><em>上海</em></span>
                        <span value=""><em>静安区</em></span>
                        <span value=""><em>城区</em></span>
                    </div>
                    <div class="area_box">
                        <div class="item first_area" style="display: block;">
                            <dl class="clearfix">
                                <dt>华北：</dt>
                                <dd value="1" name="cart_province" data-val="北京">北京</dd>
                                <dd value="3" name="cart_province" data-val="天津">天津</dd>
                                <dd value="5" name="cart_province" data-val="河北">河北</dd>
                                <dd value="6" name="cart_province" data-val="山西">山西</dd>
                                <dd value="11" name="cart_province" data-val="内蒙古">内蒙古</dd>
                            </dl>
                            <dl class="clearfix">
                                <dt>华东：</dt>
                                <dd value="2" name="cart_province" data-val="上海" class="on">上海</dd>
                                <dd value="12" name="cart_province" data-val="江苏">江苏</dd>
                                <dd value="15" name="cart_province" data-val="浙江">浙江</dd>
                                <dd value="14" name="cart_province" data-val="安徽">安徽</dd>
                                <dd value="16" name="cart_province" data-val="福建">福建</dd>
                                <dd value="13" name="cart_province" data-val="山东">山东</dd>
                            </dl>
                            <dl class="clearfix">
                                <dt>华南：</dt>
                                <dd value="19" name="cart_province" data-val="广东">广东</dd>
                                <dd value="20" name="cart_province" data-val="广西">广西</dd>
                                <dd value="23" name="cart_province" data-val="海南">海南</dd>
                            </dl>
                            <dl class="clearfix">
                                <dt>华中：</dt>
                                <dd value="21" name="cart_province" data-val="江西">江西</dd>
                                <dd value="7" name="cart_province" data-val="河南">河南</dd>
                                <dd value="17" name="cart_province" data-val="湖北">湖北</dd>
                                <dd value="18" name="cart_province" data-val="湖南">湖南</dd>
                            </dl>
                            <dl class="clearfix">
                                <dt>西南：</dt>
                                <dd value="4" name="cart_province" data-val="重庆">重庆</dd>
                                <dd value="22" name="cart_province" data-val="四川">四川</dd>
                                <dd value="24" name="cart_province" data-val="贵州">贵州</dd>
                                <dd value="25" name="cart_province" data-val="云南">云南</dd>
                                <dd value="26" name="cart_province" data-val="西藏">西藏</dd>
                            </dl>
                            <dl class="clearfix">
                                <dt>西北：</dt>
                                <dd value="27" name="cart_province" data-val="陕西">陕西</dd>
                                <dd value="28" name="cart_province" data-val="甘肃">甘肃</dd>
                                <dd value="29" name="cart_province" data-val="青海">青海</dd>
                                <dd value="30" name="cart_province" data-val="宁夏">宁夏</dd>
                                <dd value="31" name="cart_province" data-val="新疆">新疆</dd>
                            </dl>
                            <dl class="clearfix">
                                <dt>东北：</dt>
                                <dd value="8" name="cart_province" data-val="辽宁">辽宁</dd>
                                <dd value="9" name="cart_province" data-val="吉林">吉林</dd>
                                <dd value="10" name="cart_province" data-val="黑龙江">黑龙江</dd>
                            </dl>
                        </div>
                        <div class="item second_area hide">
                            <dl class="clearfix" id="cart_city_area">
                            </dl>
                        </div>
                        <div class="item third_area hide" id="cart_county_area">
                            <dl class="clearfix" id="county_city_area">
                            </dl>
                        </div>


                    </div>
                </div>
            </div>
        </div>
        <!-- 三级地址选择 end-->

    </div>
    <script id="dot-messageWrap" type="text/x-dot-template">
        <!-- 活动消息, 新版购物车里只放入通知类的提示-->
        {{? it != null }}
        {{= it}}
        {{?}}
    </script>
    <div class="top_tip wrap none" clstag="pageclick|keycount|cart_201709267|5" style="display: none;">
        <p></p>
    </div>
    <!--商品展示 start-->
    <div id="cart_main_body" data-tpa="CART_BODY"><input type="hidden" name="cart_province_id" id="cart_province_id"
                                                         value="2"><input type="hidden" name="cart_province_name"
                                                                          id="cart_province_name" value="上海"><input
            type="hidden" name="cart_city_id" id="cart_city_id" value="2817"><input type="hidden" name="cart_city_name"
                                                                                    id="cart_city_name"
                                                                                    value="静安区"><input type="hidden"
                                                                                                       name="cart_county_id"
                                                                                                       id="cart_county_id"
                                                                                                       value="51973"><input
            type="hidden" name="cart_county_name" id="cart_county_name" value="城区"><input type="hidden"
                                                                                          name="cart_county_id"
                                                                                          id="cart_town_id"><input
            type="hidden" name="cart_county_name" id="cart_town_name"><!-- 空购物车-->
        <div class="pop_serial_gift"></div>
        <div class="wrap" data-tpa="CART_ITEM_LIST">
            <div class="cart_list_header cart_wrap cart_tit">
                <span class="checkbox">
                   <input id="Checkbox1" type="checkbox" onclick="checkfk()"  class="check sumprice  check_item checked nofresh normal_item">全选</span>
                <span class="tit">商品信息</span>
                <span class="price">单价（元）</span>
                <span class="num">数量</span>
                <span class="total">小计（元）</span>
                <span class="act">操作</span>
            </div>
            <div class="cart_list">  <!-- 楼层头 start -->
                <div class="cart_tit clearfix" data-merchant-id="8888"><span class="checkbox"
                                                                             clstag="pageclick|keycount|cart_201709267|8"><a
                        href="javascript:;" class="check check_list checked" data-check-type="1"><i
                        class="iconfont"></i></a></span> <a target="_blank" href="#://www.yhd.com/"
                                                             class="label">自营</a>
                    <div id="coupon_8888" class="coupon quickly_coupon none" data-merchant-id="8888"><a
                            href="javascript:;" class="tip_trigger tag">优惠券<em></em>
                        <div class="t_arrow t_arrow_top"><span></span><i></i></div>
                    </a>
                        <div class="tip_dialog coupon_dialog pop_zIndexMore"></div>
                    </div>  <!-- 已免邮 -->
                    <div class="free_pos"><i class="iconfont"></i>已免邮 <a href="javascript:;" class="help"> <i
                            class="iconfont"></i>
                        <div class="help_dialog">
                            <div class="t_arrow t_arrow_top"><span></span> <i></i></div>
                            <p>受具体配送地址影响，精确结算运费以结算页为准</p></div>
                    </a></div>
                </div>
                <div id="merchant_8888_makeup"
                     class="sale_prod_cont similar_prod makeup_prod dialog pop_zIndexMore"></div>
                <div class="cart_list_wrap zy">
                    <ul id="shopList" class="cart_item">
                    </ul>
                </div>
                <div class="cart_amount">
                    <div class="amount">商品总价：<span><em>¥</em><em><span class="ctotal"></span></em></span></div>
                </div>
            </div>
        </div>
    </div>

    <div id="checkOutBar" class="settling_column_bar none" style="display: block;">
        <div class="pay_tools_bar tools_bar_bottom" data-tpa="SETTLEMENT_INFO_BAR">
            <div class="pay_tips pay_free_tips" style="display: none;">
                <div class="t_arrow t_arrow_top"><span></span><i></i></div>
                <a href="jaavscript:;" class="close"></a>
                <div class="free_title">领取赠品（undefined）</div>
                <div class="free_list_wrap"></div>
                <div class="btn_box"><a id="batchChooseGift" href="javascript:;" class="unable"
                                        data-tpa="CONFIRM_ADD_GIFT">确定领取</a></div>
            </div>
            <div class="pay_tools_inner clearfix">
                <!--<div class="pay_tools_l clearfix">-->
                    <!--<span class="select_all checkbox clearfix">-->
                        <!--<a class="pay_checkbox check check_all " href="javascript:;" data-check-type="0">-->
                            <!--<i class="iconfont"></i>-->
                        <!--</a>-->
                        <!--<label class="all_checked_label">全选（共<b>3</b>件）</label>-->
                    <!--</span>| <span id="batchDelete" style="display: none;">-->
                    <!--<a class="l_a_tool lt_disable" href="javascript:;">清除无效商品</a>| </span>-->
                    <!--<span><a class="l_a_tool lt_delete" href="javascript:;">批量删除</a><span>  </span></span>-->
                <!--</div>-->
                <div class="pay_tools_r clearfix">
                    <a onclick="settleAccounts()" class="checkout_btn" href="javascript:void(0);">去结算</a>
                    <div class="r_price_total r_control_tip">
                        合计：<span class="rpt_count">¥<em ><span id="pricaTal"  class="ctotal">0.00</span></em></span>
                        <i class="iconfont rpt_detail arrow_turn"></i></div>
                    <div class="r_prod_view r_control_tip">
                        <span class="rpv_count">已选商品<b id="jian">0</b>件</span>
                        <a href="javascript:;" class="pvw">预览</a> |
                        <div class="add_tip">商品已加入购物车<span></span></div>
                    </div>
                </div>
            </div> <!-- 结算栏 总价 Tips弹框 Start  -->
            <div class="pay_tips pay_total_tips" style="display: none;">
                <div class="t_arrow t_arrow_top"><span></span><i></i></div>
                <p>原价：<span>¥<em><span class="ctotal">108.00</span></em></span></p>
                <p>优惠：<span>¥<b>0.00</b></span></p>
                <p>运费：不含，以结算页为准</p>
            </div> <!-- 结算栏 总价 Tips弹框 End --> <!-- 结算栏 商品预览 Tips弹框 Start  -->
            <div class="pay_tips pay_allprod_tips" style="display: none;">
                <div class="t_arrow t_arrow_top" style="margin-left: 262.917px;"><span></span>
                    <i></i></div>
                <input id="checkoutGroups" type="hidden" value="1">
                <!--  单类型商品结算 -->
                <div class="pay_allprod_single">
                    <div class="pvw_type_cont clearfix">
                        <div class="sale_prod_cont pvw_sale_list single_sale_list">
                            <a class="control_btn left_arrow" href="javascript:;">
                                <i class="iconfont"></i>
                            </a>
                            <a class="control_btn right_arrow" href="javascript:;">
                                <i class="iconfont"></i>
                            </a>
                            <div class="sale_scroll_box">
                                <ul class="sale_scroll_ul clearfix">
                                    <li class="sale_item">
                                        <div class="prod_img">
                                            <a href="//item.yhd.com/30243456602.html" target="_blank">
                                                <img src="https://img11.360buyimg.com/cms/s75x75_jfs/t29119/273/1228783771/134097/751d80ef/5cdaa2d0Na79ab740.jpg"
                                                     width="75" height="75"> </a>
                                        </div>
                                        <div class="prod_info">
                                            <div class="opa_bg"></div>
                                            <div class="prod_txt"><a href="//item.yhd.com/30243456602.html"
                                                                     target="_blank">【乌鲁木齐馆】新疆吐鲁番哈密瓜甜瓜新鲜水果7~8斤/箱装</a>
                                            </div>
                                            <p class="prod_num">x1</p>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="redemptions" class="sale_prod_list"></div>            <!-- 特惠换购 商品列表 End -->
    <!-- 为您推荐 商品列表 Start -->
    <div>
        <form id="checkoutForm" method="post">
            <input id="checkoutForm_cart2Checkbox" name="cart2Checkbox" type="hidden">
            <input id="checkoutForm_cartSuppress" name="cartSuppress" type="hidden">
        </form>
    </div>

    <input id="currentCheckoutType" type="hidden" value="">
    <input id="splitCheckout" type="hidden" value="0">       <!-- 隐藏元素 End -->
</div>
</div>


</div>


<div class="c_global_toolbar">
    <div class="c_toolbar_wrap">
        <div class="tbar_wrap_tabs">
            <div class="t_warp_link_tabs">
                <div class="t_control_btn">
                    <a><i class="t_same iconfont"></i><em class="t_same">返回顶部</em></a>
                </div>
            </div>
        </div>

        <a class="tbar_same_close tbar_slide_close" href="javascript:;"></a>

    </div>
</div>
<div class="pop_dialog common">
    <p class="tit"></p>
    <p class="txt"></p>
    <a href="javascript:;" class="pop_close close_btn"></a>
    <div class="btn_box">
        <a href="javascript:;" class="cancel pop_close">取消</a>
        <a href="javascript:;" class="confirm pop_close">确定</a>
    </div>
</div>
<div id="flyItem"><img src="" width="50" height="50"></div>


<div id="cartBlockUI" style="display:none"></div>
<div class="pop_dialog warn_pop"></div>

<!--购物车无货商品拦截弹框-->


<!--海购分流结算-->

<!-- 设备信息接入-->
<script src="shopcar/td.js"></script>
<script src="shopcar/jdwebm.js"></script>
<div id="shSafetyPV" style="display: none;"></div>
<!-- 引入领券埋点js -->
<script src="shopcar/joya.js"></script>

<div class="ft_wrap">
    <div id="globalBottomBrowseRelated" data-recordtracker="1"></div>
    <div class="wrap ft_footer_service clearfix" id="footerIcon" data-tpa="YHD_GLOBAl_FOOTERICON">
        <a target="_blank">
            <img alt="" src="image/CgQI0lWskgmADBnsAAAPZvcSh3E68900.jpg">
            <b>正品保障</b>
            <span>正品行货 放心选购</span>
        </a>
        <a target="_blank">
            <img alt="" src="image/ChEbulWsk4iADa_aAAAM544hHN818600.jpg">
            <b>满86包邮</b>
            <span>满86元 免运费</span>
        </a>
        <a target="_blank">
            <img alt="" src="image/CgQIz1WslI-Adao3AAAN5b_ut2I80100.jpg">
            <b>售后无忧</b>
            <span>7天无理由退货</span>
        </a>
        <a target="_blank">
            <img alt="" src="image/ChEi11WsyiyALBbiAAAN9lEEK5M33200.jpg">
            <b>准时送达</b>
            <span>收货时间由你做主</span>
        </a>
    </div>

    <div class="wrap ft_service_link clearfix">
        <div id="bottomHelpLinkId" class="ft_help_list clearfix" data-tpa="YHD_GLOBAl_FOOTER_HELP">
            <dl>
                <dt>新手入门</dt>
                <dd><a href="" target="_blank">购物流程</a></dd>
                <dd><a href="" target="_blank">会员制度</a></dd>
                <dd><a href="" target="_blank">订单查询</a></dd>
                <dd><a href="" target="_blank">服务协议及隐私说明</a></dd>
                <dd><a href="" target="_blank">网站地图</a></dd>
            </dl>

            <dl>
                <dt>支付方式</dt>
                <dd><a href="" target="_blank">货到付款</a></dd>
                <dd><a href="" target="_blank">网上支付</a></dd>
                <dd><a href="" target="_blank">礼品卡支付</a></dd>
                <dd><a href="" target="_blank">其它支付</a></dd>
            </dl>

            <dl>
                <dt>配送服务</dt>
                <dd><a href="" target="_blank">配送进度查询</a></dd>
                <dd><a href="" target="_blank">商品验货与签收</a></dd>
            </dl>

            <dl>
                <dt>售后保障</dt>
                <dd><a href="" target="_blank">退换货政策</a></dd>
                <dd><a href="" target="_blank">发票制度</a></dd>
                <dd><a href="" target="_blank">帮助中心</a></dd>
            </dl>
        </div>
        <!--footer 二维码 begin -->
    </div>
    <div id="footer">
        <p class="ft_footer_link">
        </p>

        <p class="ft_footer_link">
            <a href="" target="_blank">沪ICP备16050468号</a>
            |
            <a href="" target="_blank">经营证照</a>
            |
            <a href="" target="_blank">互联网药品信息服务资格证(沪)-经营性-2017-0006</a>
            |
            <a target="_blank">违法和不良信息举报电话：0527-88100253</a>
            |
            <a href="" target="_blank">沪B2-20170039</a>
            |
            <a href="" target="_blank">沪公网安备 31010502002939号</a>
            |
            <a href="" target="_blank">友情链接</a>
            |
            <a href="" target="_blank">出版物经营许可证</a>
            |
            <a href="" target="_blank">增值电信业务经营许可证</a>

        </p>
<span id="stoId" hidden></span>
        <p>Copyright© 格调同城 2007-2019，All Rights Reserved</p>

        <small id="footerbanner2LazyLoad" class="ft_pic_link">
            <a href="" target="_blank">
                <img alt="" src="">
            </a>

            <a href="" target="_blank">
                <img alt="" src="">
            </a>

            <a href="" target="_blank">
                <img alt="" src="">
            </a>

            <a href="" target="_blank">
                <img alt="" src="">
            </a>

            <a href="" target="_blank">
                <img alt="" src="image/CgQCrlPYTqCASlHXAAAd82JE0eA31000.png">
            </a>

            <a href="" target="_blank">
                <img alt="" src="image/5a706bb1Ne3eec0dd.png">
            </a>

        </small>
    </div>
</div>
<!--js start-->
<!--无页面级头部js时, 全局头部js下移-->
<script type="text/javascript" src="js/axios.js"></script>
<script type="text/javascript" src="shopcar/global_simple_top.js" charset="utf-8"></script>
<script type="text/javascript" src="shopcar/cart_config.js" charset="utf-8"></script>
<script type="text/javascript" src="shopcar/synccookiepc.js" charset="utf-8"></script>
<script type="text/javascript">

    var resUserId;
    $(document).ready(function () {
        getSession();
        redisStore();
        searchShop();
    })
    var stId="";

    function redisStore(){
        $.ajaxSettings.async=false;
        $.getJSON(" http://ivr3ur.natappfree.cc/getRedisStoreId",function(data){
            $("#stoId").text(data);
        })
        $.ajaxSettings.async=true;
        stId=$("#stoId").text();

    }

    function getSession() {
        $.ajaxSettings.async=false;
        $.getJSON(" http://ivr3ur.natappfree.cc/selUser",function(data){
            if(data.Nickname==null||data.Nickname==""||data.Nickname=="null"){
                document.getElementById("global_login").style.display = "none";
                document.getElementById("global_unlogin").style.display = "inline";
            }
            $("#name").text(data.Nickname)
            if(data.Nickname!=null && data.Nickname!=" "&&data.Nickname!="null"){
                alert("biaoshi"+data.Nickname)
                resUserId=data.userid;
                alert(resUserId);
                document.getElementById("global_login").style.display = "inline";
                document.getElementById("global_unlogin").style.display = "none";
                if(data.Member==0){
                    $('#imgValidateCode').attr("src", "img/vip0.png");
                }else if(data.Member==1){
                    $('#imgValidateCode').attr("src", "img/vip1.png");
                }else if(data.Member==2){
                    $('#imgValidateCode').attr("src", "img/vip2.png");
                }else if(data.Member==3){
                    $('#imgValidateCode').attr("src", "img/vip3.png");
                }
            }
        })


    }

    function checkfk(){
        var allcheck=document.getElementById("Checkbox1");  //获取 全选check 的id
        var othercheck=document.getElementsByName("newslist"); //获取数组名称为fkcheck的 复选框

        for(var i=0;i<othercheck.length;i++){
            if(allcheck.checked){ othercheck[i].checked=true;
            }else{
                othercheck[i].checked=false;
            }
        }
        getMarrry();
    }

    function settleAccounts(){
        var _li=$("#shopList li");
        var _liLength=$("#shopList li").length;
        var object=[];
        for(var i=0;i<_liLength;i++){
            if(_li[i].getElementsByTagName("input")[0].checked){
                var id=_li[i].getElementsByClassName("commodityid")[0].innerHTML;
                var name=_li[i].getElementsByClassName("spName")[0].innerHTML;
                var number=_li[i].getElementsByClassName("sl")[0].innerHTML;
                var price=_li[i].getElementsByClassName("djPrice")[0].innerHTML;
                var stock=_li[i].getElementsByClassName("sStock")[0].innerHTML;
                object.push({
                    commodityid: id,
                    commodityname: name,
                    number: number,
                    unitprice: price,
                })
                $.getJSON("http://ivr3ur.natappfree.cc/updComStock",{"id":id,"stock":stock},function(data) {
                    alert(data);
                })
                axios.post("http://ivr3ur.natappfree.cc/updShopState",{"id":id,"state":1})
                    .then(function (response) {
                    if(response.data>0){
                        alert("修改成功！")
                    }
                })

            }
        }
        var date=new Date();
        var year = date.getFullYear(); //获取年
        var month = date.getMonth()+1;//获取月
        var day = date.getDate(); //获取当日
        var time = year+"-"+month+"-"+day; //组合时间
        var data={
            "storeid": stId,//分店ID
            "pricetotal": $("#pricaTal").text(),//订单总价
            "state": 0,//状态
            "endtime":time,
            "userid":1,
            "membernumber": 0,
            "paytype": '',
            // "salesclerkid": this.salesclerkid,
            "list": object,
        }
        // alert(data.pricetotal);
        this.axios.post('http://ivr3ur.natappfree.cc/insertOrder', data)
            .then(function(response){
                alert(response.data);
                window.location.href="getOrder.html";
            })


    }

    function jia(_this) {
        var Qnum=parseInt($(_this).prev().val());
        var num=parseInt(Qnum+1);
        $(_this).prev().val(num);
        var dPrice=$(_this).data('price');
        var price=dPrice*num;
        var i=$(_this).data('id');
        $("#priceTotal"+i).text(price);
        getMarrry();
    }

    function jian(_this) {
        var Qnum=parseInt($(_this).next().val());
        var num;
        if(Qnum<0){
            num=0;
        }else if(Qnum>0){
            num=parseInt(Qnum-1);
        }
        var dPrice=$(_this).data('price');
        var price=dPrice*num;
        var i=$(_this).data('id');
        $("#priceTotal"+i).text(price);
        $(_this).next().val(num);
        getMarrry();
    }

    function searchShop() {
        // alert("进入")
        $.getJSON("  http://ivr3ur.natappfree.cc/selectShopByUserId", {"userid": resUserId}, function (data) {
            // alert("查询购物车内所有的商品")
            // alert(data.length);
            var html = "";
            $("#shopList").empty();
            for (var i = 0; i < data.length; i++) {

                html += " <li id=\"2839220\" data-identifier=\"2839220\" class=\"item item_line main_item clearfix\">\n" +
                    "                            <div class=\"cart_prod clearfix\">\n" +
                    "<input onclick='getMarrry()' type='checkbox' data-price='"+data[i].saleprice * data[i].number+"' name=\"newslist\"  class=\"check sumprice  check_item checked nofresh normal_item\"/> " +
                        "<span style='display: none' class='commodityid'>"+data[i].commodityid+"</span>"+
                    "                                <a href=\"\" target=\"_blank\" class=\"item_pic\">\n" +
                    "                                    <img class=\"mainCart scrollLoading\" max-width=\"75\" max-height=\"75\"\n" +
                    "                                         src=\"image/573078e5N75e293d3.jpg\"> </a>\n" +
                    "         <span style='display: none' class='spName'>"+data[i].name+"</span><a  class=\"item_tit \"> " + data[i].name + "</a>" +
                    "                                <!-- 单价及价格标签 -->\n" +
                    "           <span style='display: none' class='djPrice'>"+data[i].saleprice+"</span> <div class=\"item_price\"><p class='JSprice'> " + data[i].saleprice + "</p>\n" +
                    "                                    <!-- 降价提醒-->  </div> <!-- 数量 -->\n" +
                    "                                <div class=\"item_num\" data-sku-id=\"2839220\">\n" +
                    "                                    <div class=\"num_act clearfix\">\n" +
                    "                                        <a href=\"javascript:;\" data-id='"+i+"' data-price='"+data[i].saleprice+"' onclick='jian(this)' id='num-jian" + i + "'>−</a>\n" +
                    "         <span style='display: none' class='sl'>"+data[i].number+"</span>  <input type=\"text\" class='sum' id='input-num" + i + "' value='" + data[i].number + "'>\n" +
                    "                                        <a href=\"javascript:;\" data-id='"+i+"' data-price='"+data[i].saleprice+"' onclick='jia(this)' class='jia' id='num-jia" + i + "' >+</a></div>\n" +
                    "                                  </div>\n" +
                    "                                <div class=\"item_amount\">\n" +
                    "                                    <div class=\"item_a_money\" > <span  id='priceTotal" + i + "'>" + data[i].saleprice * data[i].number + "</span></div>\n" +
                    "                                </div>\n" +
                    "                                <div class=\"item_act\"> <!--单品--> <a href=\"javascript:;\"\n" +
                    "                                                                    class=\"collect_btn collect_btn_2839220\" onclick='collection("+data[i].id+")' title=\"收藏\"\n>" +
                    "                                    收藏</a> <a href='javascript:;' onclick='delShopCar(" + data[i].id + ")' class=\"del_btn\">\n" +
                    "                                      删除 </a>  <!-- 套装-->  <!-- 满减 -->  <!-- 满赠 -->  </div>\n" +
                    "                                <div class=\"prop_edit\">\n" +
                    "                                    <div class=\"prop_server prop_server_orange\"><i class=\"seven_icon\"></i>\n" +
                    "                                        <div class=\"server_tips\">\n" +
                    "                                            <div class=\"t_arrow t_arrow_top\"><span></span><i></i></div>\n" +
                    "                                            <span class=\"t_txt\">支持7天无理由退货</span></div>\n" +
                    "                                    </div>\n" +
                    "                                    <div class=\"prop_txt tip_trigger serial_product  marginLf21\" data-sku-id=\"2839220\">\n" +
                    "                                        <i class=\"iconfont\"></i>\n" +
                    "                                        <div class=\"t_arrow t_arrow_top\"><span></span><i></i></div>\n" +
                    "                          <span class='sStock' style='display: none' hidden>"+data[i].number+"</span>              <span class=\"attributeName\">品牌：" + data[i].brand + "</span> <span class=\"attributeName\"></span></div>\n" +
                    "                                    <div class=\"prop_dialog tip_dialog dialog pop_zIndexMore\"></div>\n" +
                    "                                </div>\n" +
                    "                            </div> <!-- 组合子品 start-->  <!-- 组合子品 end--> <!-- 单品赠品 start-->      <!-- 单品赠品 end-->   </li>"
            }
            $("#shopList").append(html);
            getMarrry()
        })

    }

    //加入收藏
    function collection(commodityid){
        var date=new Date();
        var year = date.getFullYear(); //获取年
        var month = date.getMonth()+1;//获取月
        var day = date.getDate(); //获取当日
        var time = year+"-"+month+"-"+day; //组合时间
        // alert("当前日期："+time);
        var _data = {
            "userid": resUserId,
            "storeid": stId,
            "commodityid": commodityid,
            "createtime": time
        }
        axios.post("http://ivr3ur.natappfree.cc/insertCollections", _data)
            .then(function (response) {
                if(response.data>0){
                    alert("添加收藏成功");
                }
            })
    }

    function delShopCar(id) {
        $.getJSON("http://ivr3ur.natappfree.cc/deleteShopCarById", {"id": id}, function (data) {
            if (data > 0) {
                alert("删除成功")
                searchShop();
            }
        })
    }

   function getMarrry() {
       var _li=$("#shopList li");
       var _liLength=$("#shopList li").length;
       var num=0;
       var price=0;
       var count=0;
       for (var i=0;i<_liLength;i++){
           if(_li[i].getElementsByTagName("input")[0].checked){
               num=parseFloat(_li[i].getElementsByClassName("sum")[0].value);
               price=parseFloat(_li[i].getElementsByClassName("JSprice")[0].innerHTML);
               count+=num*price;
           }
       }
       $(".ctotal").text(count);

       var len=$("input[type='checkbox']:checked").length;
       $("#jian").html(len);

   }

</script>
</body>
</html>